<template>
  <t-image-viewer v-if="!store.isMobileType" v-model:visible="ImgVisible" :images="[urls + props.info.value]">
  </t-image-viewer>
  <van-image-preview :show-index="false" v-else v-model:show="ImgVisible" :images="[urls + props.info.value]">
  </van-image-preview>
  <div class="outline-parent jy-style-height">
    <div class="border-hover-style" style="display: flex">
      <div 
        class="content-parent"
        :style="{
          backgroundImage: 
          props.info.digitalShowroom?`url(${publicUrls + 'free/style12/Level3outlinestyle1roomBg.webp'})`:`url(${publicUrls + 'free/style12/Level3outlinestyle1Bg.webp'})`,
        }"
      >
        <div class="digitalShowroom-p" v-if="props.info.digitalShowroom">
          <digitalShowroomIcon :url="props.info.digitalShowroom" />
        </div>
        <div
          class="content-shadow"
          :style="{
            backgroundImage: `url(${publicUrls + 'free/style12/Level3outlinestyle1Bg2.webp'})`,
          }"
        ></div>
        <div
          class="content"
          :class="{
            content3: !props.info.value && props.info.subTitle && !props.info.remarks,
            content2: !props.info.value && !props.info.subTitle && !props.info.remarks,
          }"
        >
          <div
            :style="{
              backgroundImage: `url(${publicUrls + 'free/style12/Level3outlineStyle1titleBg.webp'})`,
            }"
            class="title-box"
          >
            <span>{{ props.info.text }}</span>
          </div>

          <p class="subtitle" v-if="props.info.subTitle">{{ props.info.subTitle }}</p>
          <div
            class="img-box"
            :class="{
              'img-box1': props.info.remarks && !props.info.subTitle,
              'img-box2': !props.info.remarks && props.info.subTitle,
              'img-box3': !props.info.remarks && !props.info.subTitle,
            }"
            v-if="props.info.value"
          >
            <div class="outline-cover">
              <img @click="ImgVisible = true" :src="urls + props.info.value + '?imageView2/3/format/webp'" alt="" />
            </div>
          </div>
          <div class="remarks1" v-if="props.info.value">
            <TextMax
              :infoData="props.info"
              v-if="props.domShow"
              :data="props.info.remarks"
              :title="props.info.text"
              :row="2"
            ></TextMax>
          </div>
          <div
            class="remarks2"
            :class="{
              remarks3: !props.info.subTitle,
            }"
            v-else-if="props.info.remarks"
          >
            <TextMax
              :infoData="props.info"
              v-if="props.domShow"
              :data="props.info.remarks"
              :title="props.info.text"
              :row="props.info.subTitle ? 6 : 6"
            ></TextMax>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>  

<script lang="ts">
export default defineComponent({
  name: 'free12Style12',
});
</script>

<script setup lang="ts">
import { getRemarksNum } from '@/utils/minxin';
import digitalShowroomIcon from '@/freeComponents/unitdigitalShowroom/style12.vue';
import { publicUrls } from '@/utils/minxin';
import { getTextHtml, textType } from '@/utils/minxin';
import { urls } from '@/utils/request/upload';
import { computed, defineComponent, ref } from 'vue';
import TextMax from '@/freeComponents/textMode/textMax12.vue';
import { useProjectStore } from '@/store';
import { useRouter, useRoute } from 'vue-router';
const route = useRoute();
const ImgVisible = ref(false);
const store = useProjectStore();
const title = ref();

const props = defineProps({
  info: {
    type: Object,
  },
  domShow: {
    type: Boolean,
  },
  indexs: {
    type: Number || String,
  },
});
</script>

<style scoped lang="less">
.outline-parent {
  display: flex;
  align-items: flex-end;
  position: relative;
  margin-left: 40px;
  margin-top: 0;
  height: 100%;
}
.content-parent {
  display: flex;
  position: relative;
  width: 670px; 
  height: 684px;  
  background-size: 100% 100%;
  background-repeat: no-repeat;
} 
.content-shadow {
  position: absolute;
  top: 95px;
  left: 3px;   
  width: 494px;
  height: 494px;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  animation: swing2 100s infinite ease-in-out;
  transform-origin: center center; /* 设置旋转中心为顶部中心 */
}
@keyframes swing2 {
   0% {
      transform: rotate(0deg);
    }
    100% {
      transform: rotate(360deg);
    }
}
.digitalShowroom-p {
  display: flex;
  position: absolute;
  top: 11px;
  right: 234px;
  z-index: 15;
  width: 54px;
  height: 51px;
}
.content {
  transform: scaleZ(1px);
  z-index: 15;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-top: 95px;
  margin-left: 3px;
  width: 494px;
  height: 494px;
  padding: 69px 101px 74px 103px;
}
.content2 {
  .subtitle {
    margin-top: 20px;
  }
}
.content3 {
}
.title-box {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 68px; 
  width: 290px;
  padding: 0 53px; 
  padding-right: 55px;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  :deep(span) {
    width: 182px;
    font-family: Alimama DongFangDaKai;
    font-size: 20px;
    font-weight: 400; 
    line-height: 24px; 
    text-align: center;
    background: linear-gradient(90deg, #ffeabc 0%, #fec64b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}

.subtitle {
  width: 290px;
  font-family: PingFang SC;
  font-size: 17px;
  color: rgba(255, 227, 162, 1);
  line-height: 28px;
  text-align: center;

  margin-top: 10px;
}

.img-box {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  width: 290px;
  height: 133px;
  background: linear-gradient(180deg, #f36057 0%, #df413e 100%);
  border: 1px solid rgba(255, 126, 116, 1);
  .outline-cover {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    overflow: hidden;
    img {
      transition: all 0.3s;
      width: 100%;
      height: 100%;
      object-fit: contain;
    }
  }
}
.img-box:hover {
  .outline-cover {
    img {
      transform: scale(1.2);
    }
  }
}
.img-box1 {
  height: 199px;
  margin-top: 10px;
}
.img-box2 {
  height: 198px;
  margin-top: 10px;
}
.img-box3 {
  height: 198px;
  margin-top: 20px;
}

.remarks1 {
  width: 290px;
  margin-top: 10px;
  :deep(.van-text-ellipsis) {
  }
}
.remarks2 {
  width: 290px;
  margin-top: 10px;
}
.remarks3 {
  width: 290px;
  margin-top: 20px;
}
</style>